Những câu hỏi liên quan
Quỳnh Anh Đào
Xem chi tiết
Hello Det
4 tháng 5 2022 lúc 19:27

code pascal

var f,g:text;

var s:string;

begin

assign(f,'cau2.txt'); reset(f);

read(f,s);

assign(g,'KQ.txt'); rewrite(g);

write(g,upcase(s));

close(f);

close(g);

end.

Bình luận (0)
duc tran
Xem chi tiết
Bảo Lê
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 5 2021 lúc 20:29

const fi='dl.inp'

fo='dl.out'

var f1,f2:text;

st:string;

i,d:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,st);

d:=length(st);

for i:=2 to d-1 do 

  write(f2,st[i]);

close(f1);

close(f2);

end.

Bình luận (0)
Official LEEZ
Xem chi tiết
Minh Lệ
21 tháng 3 2023 lúc 12:16

Program HOC24;

var s: string;

i,d: byte;

f1,f2: text;

fi='Xau.mp'

fo='KQ.Out'

begin

assign(f1,fi);

assign(f2,fo);

reset(f1);

rewrite(f2);

readln(f1,s);

d:=0;

for i:=1 to length(s) do if s[i]='a' then d:=d+1;

write(f2,d);

close(f1); close(f2);

end.

Bình luận (0)
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
U Lan
Xem chi tiết
ᝰᦔꫀꪑꪮꪀ
Xem chi tiết
Nguyễn Lê Phước Thịnh
1 tháng 5 2021 lúc 19:25

Câu 1: 

uses crt;

var st:string;

d,i,dem:integer;

begin

clrscr;

write('Nhap xau:'); readln(st);

d:=length(st);

write('Xau sau khi xoa so la: ');

for i:=1 to d do 

  if not(st[i] in ['0'..'9']) then write(st[i]);

writeln;

dem:=0;

for i:=1 to d do 

  if st[i]=#32 then inc(dem);

writeln('Xau co ',dem,' dau cach');

writeln('Do dai cua xau la: ',d);

readln;

end. 

Bình luận (1)
Nguyễn Lê Phước Thịnh
1 tháng 5 2021 lúc 19:26

Câu 2: 

uses crt;

const fi='kq.out'

var st1,st2:string;

f1:text;

begin

clrscr;

write('Nhap xau thu 1:'); readln(st1);

write('Nhap xau thu 2:'); readln(st2);

assign(f1,fi); rewrite(f1);

if length(st2)>length(st1) then writeln(f1,st2)

else writeln(f1,st1);

close(f1);

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
1 tháng 5 2021 lúc 19:28

Câu 3: 

uses crt;

var a:array[1..100]of integer;

i,n,t,dem:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

t:=0;

dem:=0;

for i:=1 to n do 

  if a[i] mod 2=0 then

begin

t:=t+a[i];

inc(dem);

end;

writeln('Trung binh cong cac so chan la: ',t/dem:4:2);

readln;

end.

Bình luận (0)